import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    { path: '/login', component: () => import('@/views/login/LoginPage.vue') },
    {
      path: '/',
      component: () => import('@/views/layout/LayoutContainer.vue'),
      redirect: '/home',
      children: [
        {
          path: '/home',
          component: () => import('@/views/home/HomePage.vue')
        },
        {
          path: '/content/write',
          component: () => import('@/views/content/WriteArticlePage.vue')
        },
        {
          path: '/content/article',
          component: () => import('@/views/content/ArticlePage.vue')
        },
        {
          path: '/content/category',
          component: () => import('@/views/content/CategoryPage.vue')
        },
        {
          path: '/content/link',
          component: () => import('@/views/content/LinkPage.vue')
        },
        {
          path: '/content/span',
          component: () => import('@/views/content/SpanPage.vue')
        },
        {
          path: '/system/user',
          component: () => import('@/views/system/UserPage.vue')
        },
        {
          path: '/system/role',
          component: () => import('@/views/system/RolePage.vue')
        },
        {
          path: '/system/menu',
          component: () => import('@/views/system/MenuPage.vue')
        }
      ]
    }
  ]
})

export default router
